/**
 * Created by WT-SUN on 2017/5/22.
 */
$(function () {
    var rId = $.getQueryParam('id');
    $('#rInfoTb').datagrid({
        rownumbers: true,//显示行号
        striped: true,
        fit: true,
        singleSelect: true,
        sortOrder: true,
        fitColumns: true,
        pagination: true,
        url:ROOT_PATH + '/threeSimultaneities/report/infoTb.shtml',
        queryParams: {
            sort: 'addTime',
            order: 'asc',
            monthReportId:rId
        },
        columns: [[
            {
                field: 'id',checkbox:true
            },
            {
                field: 'proName', title: '项目名称', width: 200,formatter: function (value, row, index) {
                return "<a href='javascript:void(0)' class='easyui-linkbutton text-primary' plain='true'   onclick='infodReport(\""+row.id+"\");'>"+row.proName+"</a>";
            }},
            {field: 'specialtyIdName', title: '专业分类', width: 100},
            {field: 'problemTypeIdName', title: '问题分类', width: 100},
            {field: 'problems', title: '问题描述', width: 200},
            {field: 'rectifyPlan', title: '整改方案', width: 100},
            {field: 'rectifyCondition', title: '整改情况', width: 100},
            {field: 'realName', title: '整改人', width: 100},
            {field: 'rectifyTime', title: '整改时间', width: 100},
            {field: 'rectifyStateId', title: '整改状态', width: 80,formatter: function (value, row, index) {
                return row.rectifyStateId=='1'?'已整改':'整改中';
            }}
        ]]
    });
    
});

function infodReport(id) {
    var title = '月报明细';
    var content = ROOT_PATH + '/threeSimultaneities/report/reInfo.shtml?id='+id;
    parent.layer.open({
        type: 2,
        resize: false,
        title: title,
        area: ['1150px', '65%'],
        content: content
    });
}
